package com.ruoyi.system.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.MaterialLogEntity;
import com.ruoyi.system.domain.MaterialLogStatisticsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 角色表 数据层
 *
 * @author ruoyi
 */
@Mapper
public interface MaterialLogMapper extends BaseMapper<MaterialLogEntity> {

    @Select("SELECT name, DATE(create_time) AS time_format, SUM(num) AS num " +
            "FROM  t_material_record WHERE create_time BETWEEN #{beginTimeFormat} AND #{endTimeFormat} " +
            "GROUP BY name, DATE(create_time) " )
    List<MaterialLogStatisticsEntity> sumNumByDateAndName(@Param("beginTimeFormat") String beginTimeFormat, @Param("endTimeFormat") String endTimeFormat);
}
